﻿using UnityEngine;
using System.Collections;

public class CycleTutTex : MonoBehaviour {

	public Texture2D[] tutTex;
	int i;
	public Texture2D forwardArrow, backArrow, Main;

	void Start(){
		i = 0;
		renderer.material.mainTexture = tutTex[i];
	}
	void OnGUI(){
		if(GUI.Button(new Rect(Screen.width/2 - 50, Screen.height/2 - 280, 100, 70), Main)){
            Manager.MainMenu();
            Application.LoadLevel(0);

		}
		if(GUI.Button(new Rect(Screen.width/2 + 100, Screen.height/2 - 280, 70, 70), forwardArrow)){
			Debug.Log(i);
			if(i < tutTex.Length ){
			i ++;
			renderer.material.mainTexture = tutTex[i];
			}
		}
		if(GUI.Button(new Rect(Screen.width/2 -180, Screen.height/2 -280, 70, 70), backArrow)){
			if(i >=  0){
			i --;
			renderer.material.mainTexture = tutTex[i];
			}
		}

	}
}
